import com.alibaba.dubbo.container.spring.SpringContainer;
import com.vichat.task.TaskFrameWork;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;

/**
 * Created by wangluyin on 2017/1/21.
 */
public class Main {
    protected static final Logger logger = LoggerFactory.getLogger(Main.class);

    public static void main(String[] args) throws Exception {
        com.alibaba.dubbo.container.Main.initContainers(args);
        ApplicationContext ctx = SpringContainer.getContext();
        //定時任務
        TaskFrameWork taskFrameWork = (TaskFrameWork) ctx.getBean("taskFrameWork", TaskFrameWork.class);
        if(args !=null && args.length > 0){
            logger.info("TASK:"+args[0]);
            taskFrameWork.main(args[0]);
        }else {
            taskFrameWork.main("ONLINE_USER");
        }

    }
}
